import { observable, action } from "mobx";
import { WeaLocaleProvider } from 'ecCom';
const { getLabel } = WeaLocaleProvider;

export default class PaginationStore {
    @observable pageSize: number = 10;
    @observable current: number = 1;
    @observable total: number = 0;
    @observable showQuickJumper=true;
    @observable showSizeChanger=true;
    @observable pageSizeOptions=[10,20,50,100];
    showTotal=total=>` ${getLabel(18609,"共")+total+' '+getLabel(18256,"条")} `

    @action
    onChange = (current: number = this.current, pageSize: number = this.pageSize) => {
        this.current = current;
        this.pageSize = pageSize;
    }

    @action
    onShowSizeChange = (current: number = this.current, pageSize: number = this.pageSize) => {
        this.current = current;
        this.pageSize = pageSize;
    }
}